package com.level.restful.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Properties;

public class PropertiesUtil {
	public static String getkey(String key, String filePath) {
		Properties prop = new Properties();
		String returnStr = "";
		InputStream in = PropertiesUtil.class.getClassLoader()
				.getResourceAsStream(filePath);
		try {
			prop.load(in);
			returnStr = (String) prop.get(key);
			returnStr = new String(returnStr.getBytes("iso-8859-1"), "gbk");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return returnStr;
	}
}